<?php
/**
 * Created by PhpStorm.
 * User: Administrator
 * Date: 2021/9/2
 * Time: 15:33
 */
namespace app\common\model;
use think\Model;
use think\Db;

class Wechat extends Model
{
    //微信小程序
    public function mini_config($header=''){
        if($header==''){
             $config = [
                'app_id'=>'wx02bbac15929b5234',
                'app_secret'=>'186cb18bf5df3436986435a145221c6a',
                'map_key'=>'SMRBZ-MQBKO-PR5WE-SVCFC-SBJBQ-TNFMQ',
                'uniacid' =>2,
                'wxkey'=>'18545005769shimengwangluo8888888',
                'mchid' => "1602321185",
                'is_yuepay' =>0,
                'is_jfpay' =>0,
            ];
        }elseif ($header['Appid']=='wx02bbac15929b5234'){
             $config = [
                'app_id'=>'wx02bbac15929b5234',
                'app_secret'=>'186cb18bf5df3436986435a145221c6a',
                'map_key'=>'SMRBZ-MQBKO-PR5WE-SVCFC-SBJBQ-TNFMQ',
                'uniacid' =>2,
                'wxkey'=>'18545005769shimengwangluo8888888',
                'mchid' => "1602321185",
                'is_yuepay' =>0,
                'is_jfpay' =>0,
            ];
        }elseif ($header['Appid']=='2021002181608453'){
             $config = [
                'app_id'=>'wx02bbac15929b5234',
                'app_secret'=>'186cb18bf5df3436986435a145221c6a',
                'map_key'=>'SMRBZ-MQBKO-PR5WE-SVCFC-SBJBQ-TNFMQ',
                'uniacid' =>2,
                'wxkey'=>'18545005769shimengwangluo8888888',
                'mchid' => "1602321185",
                'is_yuepay' =>0,
                'is_jfpay' =>0,
            ];
        }elseif ($header['Appid']=='wx3a07030c12fcea8a'){
             $config = [
                'app_id'=>'wx3a07030c12fcea8a',
                'app_secret'=>'1e1e1a6573d511bee7a43b8379bc0494',
                'map_key'=>'SMRBZ-MQBKO-PR5WE-SVCFC-SBJBQ-TNFMQ',
                'uniacid' =>3,
                'wxkey'=>'18545005769shimengwangluo8888888',
                'mchid' => "1602321185",
                'is_yuepay' =>0,
                'is_jfpay' =>0,
            ];
        }elseif ($header['Appid']=='wx70b624bc13e997d6'){
             $config = [
                'app_id'=>'wx70b624bc13e997d6',
                'app_secret'=>'3fb5db32479fe281f175fe46f7fba142',
                'map_key'=>'SMRBZ-MQBKO-PR5WE-SVCFC-SBJBQ-TNFMQ',
                'uniacid' =>4,
                'wxkey'=>'18545005769shimengwangluo8888888',
                'mchid' => "1602321185",
                'is_yuepay' =>0,
                'is_jfpay' =>0,
            ];
        }

        $config['title'] = "《数字轩煌》云点餐";
        $config['link_logo'] = "https://e.shimeng.net.cn/static/theme/img/logo.jpg";
        $config['tel'] = "13681588997";

        return $config;
    }

    //随机订单号
    public function order_sn(){
        return date('YmdHis') . str_pad(mt_rand(1, 99999), 5, '0', STR_PAD_LEFT);
    }

    

}